<template>
  <Guard :appId="appId" :config="guard_config" @login="onLogin" @register="onRegister"></Guard>
</template>

<script>
import { Guard } from "@authing/vue-ui-components";
import "@authing/vue-ui-components/lib/index.min.css";


export default {
  name: 'LoginView',
  data(){
    return {
      appId: "62de9dba412eabb062f40ab2",
      guard_config: {
        autoRegister:true,
        disableRegister:false,
        contentCss:".g2-view-container {margin: 0 auto;}",
      },
    }
  },
  components: {
    Guard
  },
  computed: {
  },
  methods: {
    onLogin(userInfo) {
      this.$store.commit('setUser',userInfo)
      this.$router.replace({path:'/'})
    },
    onRegister(userInfo) {
      this.$store.commit('setUser',userInfo)
      this.$router.replace({path:'/'})
    }
  }
}
</script>

<style>

</style>